home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programmierung
/
Power-Programmierung (Tewi)(1994).iso
/
batch
/
library
/
batutl2
/
signal.asm
< prev
next >
Wrap
Assembly Source File
|
1988-04-20
|
3KB
|
115 lines
TITLE SIGNAL 12-28-84 [4-16-88]
;Toad Hall Disassembly, tweak
;Don't really understand what this is trying to do
;(except wait for kbd input and beep periodically).
;But I've faithfully (kinda) kept with the spirit of the
;original code.
LF EQU 0AH
CR EQU 0DH
;
;INITIAL VALUES : CS:IP 0000:0100
; SS:SP 0000:FFFF
CodeSeg SEGMENT
ASSUME DS:CodeSeg,SS:CodeSeg,CS:CodeSeg,ES:CodeSeg
ORG 100H
Signal proc near
JMP SHORT Start
prompt DB 'Press any key to continue.......$'
CrLf db CR,LF,'$'
byte_124 DB 20H
wconst_127 dw 06A0H ;magic sound numbers
wconst_129 dw 0350H
wconst_12B dw 06A0H
wconst_12D dw 0350H
Start:
MOV SI,80H ;point to PSP cmd line
CMP BYTE PTR [SI],0 ;cmd line length 0?
JNZ L014A ; nope, continue
mov DX,offset prompt ;'press any key to continue...'
MOV AH,9 ;display string
INT 21H
JMP SHORT KbdLup_16E ;get kbd input, exit
L014A: xor cx,cx ;clear msb
MOV CL,[SI] ;get cmd line length byte
DEC CL ;adjust
DEC CL ;-2
INC SI ;bump cmd line ptr 2
INC SI
MOV BL,[SI] ;snarf char
MOV byte_124,BL ;save here
Lup15A: INC SI ;bump cmd line ptr
MOV DL,[SI] ;get cmd line char
CMP DL,byte_124 ;same as first cmd line char?
JNZ L0168 ; nope, go display it
CALL Do_CrLf
LOOP Lup15A ;retry
L0168: MOV AH,2 ;display output in DL
INT 21H
LOOP Lup15A ;retry
;beep until kbd input, then exit
KbdLup_16E:
MOV AH,0BH ;check kbd input status
INT 21H
CMP AL,0FFH ;anything there?
JZ Read_Kbd ; yep, read it, exit
;make some flashy sounds
MOV BX,wconst_127 ;constant 06A0H
CALL Beep
MOV BX,wconst_129 ;constant 0350H
CALL Beep
MOV BX,wconst_12B ;constant 06A0H
CALL Beep
MOV BX,wconst_12D ;constant 0350H
CALL Beep
xor cx,cx ;nice delay counter
Lup1A4: NOP
LOOP Lup1A4
JMP SHORT KbdLup_16E ;check kbd again
Read_Kbd:
MOV AH,7 ;kbd input w/o echo
INT 21H
;no document with this, so donno WHAT to do with that char!
;Should we return it as an Errorlevel? Why not...
mov ah,4CH ;terminate process
int 21H ;done
Signal endp
Do_CrLf proc near
mov dx,offset CrLf
mov ah,9 ;display string
int 21H
RET
Do_CrLf endp
Beep proc near
MOV AL,0B6H ;enable sound reg?
OUT 43H,AL
mov ax,bx ;sound freq in bx
OUT 42H,AL
MOV AL,AH ;freq msb?
OUT 42H,AL
IN AL,61H ;get sound reg value
MOV AH,AL ;save a sec
OR AL,3
OUT 61H,AL ;sound on
SUB CX,CX ;nice delay loop
Lup1D2: LOOP Lup1D2
MOV AL,AH ;restore sound reg value
OUT 61H,AL ;sound off
RET
Beep endp
CodeSeg ENDS
END Signal